package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.Invoices;




public class InvoicesDao extends IbatisDao{
	
	public List selectInvoices() throws SQLException {
		List selectInvoices = null;
			selectInvoices =getSqlMap().queryForList("SELECT_ALL_INVOICES", null);
		return selectInvoices;
	}

	public int deleteInvoices(Invoices invoices) throws SQLException{
		return (int) getSqlMap().delete("DELETE_INVOICES", invoices);
	}
	
	public int updateInvoices(Invoices invoices) throws SQLException{
		return (int) getSqlMap().update("UPDATE_INVOICES", invoices);
	}
	
	public Invoices insertInvoices(Invoices invoices) throws SQLException{
		return (Invoices) getSqlMap().insert("INSERT_INVOICES", invoices);
	}
	
		
	public static void main (String args[]) throws SQLException{
		Invoices invoices;
		invoices = new Invoices();
		invoices.setTerms("Coba dari Main");
		new InvoicesDao().insertInvoices(invoices);
		}
	
}